package com.hifar.test.api.model;

/**
 * 简化的处理错误信息
 * 只包含具体的校验步骤失败信息
 */
public class SimpleProcessingError {
    
    private String step;
    private String errorMessage;
    private String fieldName;
    private Object fieldValue;
    private String suggestion;
    
    public SimpleProcessingError() {}
    
    public SimpleProcessingError(String step, String errorMessage) {
        this.step = step;
        this.errorMessage = errorMessage;
    }
    
    public SimpleProcessingError(String step, String errorMessage, String fieldName, Object fieldValue) {
        this.step = step;
        this.errorMessage = errorMessage;
        this.fieldName = fieldName;
        this.fieldValue = fieldValue;
    }
    
    // Getters and Setters
    public String getStep() {
        return step;
    }
    
    public void setStep(String step) {
        this.step = step;
    }
    
    public String getErrorMessage() {
        return errorMessage;
    }
    
    public void setErrorMessage(String errorMessage) {
        this.errorMessage = errorMessage;
    }
    
    public String getFieldName() {
        return fieldName;
    }
    
    public void setFieldName(String fieldName) {
        this.fieldName = fieldName;
    }
    
    public Object getFieldValue() {
        return fieldValue;
    }
    
    public void setFieldValue(Object fieldValue) {
        this.fieldValue = fieldValue;
    }
    
    public String getSuggestion() {
        return suggestion;
    }
    
    public void setSuggestion(String suggestion) {
        this.suggestion = suggestion;
    }
    
    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append("步骤: ").append(step);
        sb.append(", 错误: ").append(errorMessage);
        if (fieldName != null) {
            sb.append(", 字段: ").append(fieldName);
        }
        if (fieldValue != null) {
            sb.append(", 值: ").append(fieldValue);
        }
        return sb.toString();
    }
}
